config, callback, drawing, main: add LINE and RECT tools, and arrowtype… - #192
pascal-niklaus wants to merge 1 commit into
Conversation
|
This looks exciting as it's an often requested feature (#67)! Can you split the PR into one for each tool and one for the arrow type? That'd be awesome! |
That is possible, but LINE and RECT are very related, since both use the same buffer of the original state (basically, at on_button_press a copy of back_buffer is made, and during on_motion the rectangle or line are drawn onto this copy, allowing to dynamically "drag" the rectangle or line. I could separate out the arrow head code, if this helps, but it really is quite straightforward, and this modification is not independent of LINE (since LINE can have two arrow heads as well). So if a split is indeed required, I would keep LINE and RECT together, and then produce a 2nd PR with the arrow style that can be applied on top of the first PR. |
|
Yeah that sounds good! |
|
Closing in favour of #193. |
This adds a LINE and RECT option to draw straight lines and rectangles. Also, arrows can have heads at either or both ends, owing to the new arrowtype option which can be "<-" "->" or "<->".
Here is an example with the corresponding config file.